package com.example.login.Service;

import com.example.login.Mapper.SellerMap;
import com.example.login.Pojo.Seller;
import com.example.login.Pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("SellerService")
public class SellerService {
    @Autowired
    SellerMap sellerMap;
    public Seller isSeller(String username,String password)//返回是否通过
    {
        Seller seller= sellerMap.getSellerByName(username);
        if(seller==null||seller.getId()==-1)return null;
        else if(!seller.getPassword().equals(password))return null;
        return seller;
    }
    //public JdbcTemplate jdbcTemplate=new JdbcTemplate();
    public void Registe(String username,String password,String storeName)//返回是否通过
    {
        //String sql="insert into xtshop_user values(?,?,?,?,?,?);";
        // jdbcTemplate.update(sql,id,username,"46546",password,0,0);

        sellerMap.Register(username, password,storeName);
    }
}
